import {defineStore} from 'pinia'
import axios from '../axios'

const albumStore = defineStore({ 
    id: 'albumStore',
    state: () => ({ 
        albumList: []
    }),
    actions: { 
        getAlbumStore () { 
            const thiss = this
            return new Promise((resolve, reject) => { 
                axios.get('album_list').then(res => { 
                    resolve(res.data)
                    thiss.albumList = res.data
                }).catch(err => { 
                    reject(err.data)
                })
            })
        }
    }
})

export default albumStore